package com.foreknow.demo4;

public class Swallow extends Bird{

    public void fly(){
        System.out.println(this.getName()+"正在飞");
    }

    public static void main(String[] args) {
        //创建子类
        Swallow swallow = new Swallow();
        swallow.setName("tom");
        swallow.eat();
        swallow.fly();
    }
}
